<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div class="modal" id="addRemitApplyDialog">
	<input type="hidden" name="id" id="id">
	<div class="modal-dialog">
		
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closeAddRemitApplyDialog()">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title">添加申请</h4>
			</div>
			<div class="form-horizontal">
				<div class="modal-body" id="addRemitApplyForm">
					<!-- <div class="form-group">
							<label for="inputName" class="col-sm-3 control-label">提现订单号</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="outTradeNo" name="outTradeNo" value="" />
							</div>
					</div> -->
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">结算账号</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="bankAccountNo" name="bankAccountNo" value="" />
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">结算户名</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="bankAccountName" name="bankAccountName" value="" />
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">账户类型</label>
						<div class="col-sm-7">
							<select class="form-control" id="bankAccountType" name="bankAccountType">
								<option value="">账户类型</option>
								<option value="PRIVATE_DEBIT_ACCOUNT">对私借记卡</option>
								<option value="PUBLIC_ACCOUNT">对公账户</option>
							</select>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">结算金额</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="settAmount" name="settAmount" value="" />
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">收款人手机号</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="phoneNo" name="phoneNo" value="" />
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">证件号码</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="cardNo" name="cardNo" value="" />
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">银行类别</label>
						<div class="col-sm-7">
							<select class="form-control" id="bankCode" name=bankCode>
								<option value="">银行类别</option>
								<option value="ICBC">工商银行</option>
								<option value="CMBCHINA">招商银行</option>
								<option value="ABC">中国农业银行</option>
								<option value="CCB">建设银行</option>
								<option value="BCCB">北京银行</option>
								<option value="BOCO">交通银行</option>
								<option value="CMBC">中国民生银行</option>
								<option value="PINGANBANK">平安银行</option>
								<option value="CIB">兴业银行</option>
								<option value="NJCB">南京银行</option>
								<option value="CEB">广大银行</option>
								<option value="BOC">中国银行</option>
								<option value="CGB">广发银行</option>
								<option value="SHB">上海银行</option>
								<option value="SPDB">上海浦东发展银行</option>
								<option value="POST">中国邮政</option>
								<option value="CBHB">渤海银行</option>
								<option value="HKBEA">东亚银行</option>
								<option value="NBCB">宁波银行</option>
								<option value="ECITIC">中信银行</option>
								<option value="BJRCB">北京农村商业银行</option>
								<option value="HXB">华夏银行</option>
								<option value="CZ">浙商银行</option>
								<option value="HZBANK">杭州银行</option>
								<option value="SRCB">上海农村商业银行</option>
								<option value="NCBBANK">南洋商业银行</option>
								<option value="SCCB">河北银行</option>
								<option value="ZJTLCB">泰隆银行</option>
								<option value="BOCDBANK">成都银行</option>
							</select>
						</div>
					</div>
					
				    <!-- <div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">联行号</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="bankBranchNo" name="bankBranchNo" value="" />
						</div>
					</div> -->
					
					<!-- <div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">支行名称</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="bankBranchName" name="bankBranchName" value="" />
						</div>
					</div> -->
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">交易类型</label>
						<div class="col-sm-7">
							<select class="form-control" id="proxyType" name="proxyType">
								<option value="">交易类型</option>
								<option value="T0">T0</option>
								<option value="T1">T1</option>
							</select>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">产品类型</label>
						<div class="col-sm-7">
							<select class="form-control" id="productType" name="productType">
								<option value="">产品类型</option>
								<option value="WEIXIN">微信</option>
								<option value="ALIPAY">支付宝</option>
								<option value="QUICKPAY">快捷</option>
							</select>
						</div>
					</div>
					
					<!-- <div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">开户行所在省</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="province" name="province" value="" />
						</div>
					</div> -->
					
					<!-- <div class="form-group">
						<label for="inputName" class="col-sm-3 control-label">开户行所在市</label>
						<div class="col-sm-7">
							<input type="text" class="form-control" id="city" name="city" value="" />
						</div>
					</div> -->
					
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default pull-left" data-dismiss="modal" onclick="closeBankCardDialog()">关 闭</button>
					<button type="submit" class="btn btn-primary" id="addRemitApply">确 认</button>
				</div>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->


<script>
	$("#addRemitApplyDialog #addRemitApply").on("click",function(){
		addRemitApply();
	});
/* ============添加结算申请事件============== */
  function addRemitApply(){
	  var bankAccountNo = $('#addRemitApplyForm #bankAccountNo').val();
	  var bankAccountName = $('#addRemitApplyForm #bankAccountName').val();
	  var bankAccountType = $('#addRemitApplyForm #bankAccountType').val();
	  var settAmount = $('#addRemitApplyForm #settAmount').val();
	  var phoneNo = $('#addRemitApplyForm #phoneNo').val();
	  var cardNo = $('#addRemitApplyForm #cardNo').val();
	  var bankCode = $('#addRemitApplyForm #bankCode').val();
	  var proxyType = $('#addRemitApplyForm #proxyType').val();
	  var productType = $('#addRemitApplyForm #productType').val();
	  
    if(bankAccountNo == null || $.trim(bankAccountNo) == ""){
		alertMsg("请输入结算账号","danger");
	}else if(bankAccountName == null || $.trim(bankAccountName) == ""){
		alertMsg("请输入结算用户名","danger");
	}else if(bankAccountType == null || $.trim(bankAccountType) == ""){
		alertMsg("请选择账户类型","danger");
	}else if(settAmount == null || $.trim(settAmount) == ""){
		alertMsg("请输入结算金额","danger");
	}else if(phoneNo == null || $.trim(phoneNo) == ""){
		alertMsg("请输入收款人手机号","danger");
	}else if(cardNo == null || $.trim(cardNo) == ""){
		alertMsg("请输入证件号码","danger");
	}else if(bankCode == null || $.trim(bankCode) == ""){
		alertMsg("请选择银行类别","danger");
	}
	else if(proxyType == null || $.trim(proxyType) == ""){
		alertMsg("请选择交易类型","danger");
	}else if(productType == null || $.trim(productType) == ""){
		alertMsg("请输入产品类型","danger");
	}else{
		 $.ajax({
		        type : "POST",          
		        url : "${baseURL }/merchant/remitApply/addRemitApply",    
		        dataType : "json",     
		        data : {
		        	"bankAccountNo" : bankAccountNo,
		        	"bankAccountName" : bankAccountName,
		        	"bankAccountType" : bankAccountType,
		        	"settAmount" : settAmount,
		        	"phoneNo" : phoneNo,
		        	"cardNo" : cardNo,
		        	"bankCode" : bankCode,
		        	"proxyType" : proxyType,
		        	"productType" : productType
		        },
		        success : function(result) {  
		        	if(result.code == 0){
		        		alertMsg(result.msg,"success");
		        		$("#addRemitApplyDialog").modal("hide");
		        		searchRemit();
		        	}else{
		        		alertMsg(result.msg,"danger");
		        		$("#addRemitApplyDialog").modal("hide");
		        	}
		        },
		        error : function() {
		        	alertMsg("系统异常！","danger");
		        	$("#addRemitApplyDialog").modal("hide");
		        }  
			  });
	}
  }

  function closeAddRemitApplyDialog(){
	  var bankAccountNo = $('#addRemitApplyDialog #"bankAccountNo"').val("");
	  var bankAccountName = $('#addRemitApplyDialog #bankAccountName').val("");
	  var bankAccountType = $('#addRemitApplyDialog #bankAccountType').val("");
	  var settAmount = $('#addRemitApplyDialog #settAmount').val("");
	  var phoneNo = $('#addRemitApplyDialog #phoneNo').val("");
	  var cardNo = $('#addRemitApplyDialog #cardNo').val("");
	  var bankCode = $('#addRemitApplyDialog #bankCode').val("");
	  var proxyType = $('#addRemitApplyDialog #proxyType').val("");
	  var productType = $('#addRemitApplyDialog #productType').val("");
	}
  
</script>